package demo2;

/**
 * Remarks:
 * Class name :StacticProxy
 * Date :2023/2/13 23:19
 * Author:杨俊源
 */
public class StacticProxy {

    public static void main(String[] args) {

        You you = new You();
        new Thread(()-> System.out.println("我爱你")).start();
        new WeddingCompany(new You()).HappyMarry();
    }

}

interface Marry{
    void HappyMarry();

}

class You implements Marry{

    @Override
    public void HappyMarry() {
        System.out.println("结婚了，很开心");
    }
}

class WeddingCompany implements Marry{

    private Marry target;

    public WeddingCompany(Marry target){
        this.target = target;
    }

    @Override
    public void HappyMarry() {
        before();
        this.target.HappyMarry();
        after();
    }

    private void before() {
        System.out.println("结婚之前，布置现场");
    }
    private void after() {
        System.out.println("结婚之后，生矮子");
    }
}
